<?php

include_once '../Configuration.php';

class DaConnector {

    static $connection = NULL;

    public function OpenConnection() {

        $config = new Configuration();

        if ($connection == NULL) {
            $connection = mysqli_connect($config->server, $config->username, $config->password, $config->database, $config->databaset);
            if(mysqli_connect_errno($connection) != 0){
                return 'Error';
            }
        }
        return $connection;
    }

}

?>
